All Questions
237 questions
0votes
1answer
53views
Is there a tool to "recursively" move/rename a directory (with conflicts/merging)?
Imagine I want to move (rename) a directory tree /var/lib/postgres/data to /var/lib/postgres/data.old: /var/lib/postgres └── data ├── base │ ├── 16390 │ │ └── <...> │ └── ...
-2votes
1answer
51views
Is there a port of the Windows' REN command for Unix-like operating systems? [duplicate]
I already know the rename command in GNU/Linux. However, it is very complicated and cumbersome because it uses regular expressions. For example, in Windows, I can simply rename files in bulk by typing:...
0votes
1answer
440views
Rename file in Mac OS Terminal using Regex or translate from Windows Script
I would like help with a shell script for macOS to rename files with a certain pattern. The script would handle only one file, not multiple. Here are three examples: a. Public Talks_ (189) Walking ...
0votes
1answer
89views
Need help with a script that mv (renames) filenames that require single quotes in ls output or file operations
I need help with a script that mv (renames) filenames that are shown with single quotes in ls output or files that require single quotes for file operations. The script will be used to rename all ...
0votes
1answer
252views
Change file name based on contents
I'm trying to rename a set of files based on what is in the file itself. I have likely more than a thousand files to rename by the time I'm done. I have code that will get me the first part of the ...
1vote
1answer
634views
Copying/moving and renaming files from multiple subdirectories to parent directory
I have multiple directories, and each one of those directories contains an "example" directory which in turn contains images. What I want to do, is to add a textual suffix at the end of a ...
0votes
2answers
2kviews
Rename files using regex to delete part of name
I have a bunch of files that I have to process on a Linux machine. The files look like this: 2009-08-18T034353_DR1_4N-NAC_123456_1234_band1.ntf 2009-08-18T034353_DR1_4N-...
4votes
1answer
616views
Using perl's rename to renumber a list of files, starting at a certain value
I'm trying to renumber a list of files, which at a given point in their filename have one index consisting of a four-digit number. These files are consistently output starting from 0001, but need to ...
1vote
1answer
56views
fix filenames with wrong starting and ending character(s) in Bash, mass renaming
I need to rename a lot of files by removing the 1st and the last characters (before .ext). WRONG> '1st moto ride [Aug '99]'.mp4 'Samuel' Song'.mp3 'Plane Landing'.avi '"Ode" (sort of) to ...
3votes
1answer
3kviews
BASH recursive rename of js files to jsx
On a mac I'm migrating a create react app to vite and have a lot of *.js files that need changing to *.jsx. I done this manually once in my life and this is enough for one eternity. I need a simple to ...
2votes
1answer
2kviews
How to bulk rename files/directories containing spaces?
How can you bulk rename many files and/or directories by replacing a snippet f o o with b a r in the file/directory name? For each suggested method, preferably answer the following questions. Is it ...
1vote
3answers
333views
Can one do the equivalent of "rm -rf targetdir && mv sourcedir targetdir" with one command?
There are a few ways to interpret the operation of "replacing one file with another", but the one I want to focus on here is the one that can be achieved with the command mv /that/there/...
0votes
2answers
792views
Renaming all files in the current directory to names listed in a text file
The original title was: Injecting vidir with vim like sequence of commands I have been trying to use vidir to rename multiple files which are accidently renamed by someone. Problem is vidir doesnt use ...
0votes
1answer
245views
Changing part of the name of many files to unique names, using a spreadsheet of names
I need some help. I want to rename very many files with unique filenames using bash. I want to keep part of the original filename. For example: current file name new file name F1.R23.fastq.gz 10_1.F1....
4votes
2answers
1kviews
How to rename multiple files by changing one component of the file name?
I found lots of questions about how to rename multiple files using the command line. However I am not able to solve my specific issue which is renaming this file name: ...